<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title></title>
  </head>
  <body>
    <script type="text/javascript">
      function fn(){
        var a = 1;
        const f = function(){
          console.log(a);
        }
        return f;
      }
      
      var ff = fn(); // var ff = f;
      ff();
      ff = null;
      console.log(ff);
      
      var num = 5;
      var auto = setInterval(function(){
        num--;
        if(num<=0){
          // 清理定时器
          clearInterval(auto);
        }
        console.log(num)
      },1000);
      
      
      // function test(){
      //   var b = 2;
      //   console.log(b);
      // }
      // var t = test();
      // console.log(t);
      
      
      
    </script>
  </body>
</html>
